/*
 *  $Id: Mana.cs 1053 2010-05-19 10:05:23Z thenn.erannor $
 *  This file is a part of Ragima CCG.
 *  (C) 2008 Ragima development group.
 *
 *  Licensed under the terms of the GNU GPL License version 2.
 *
 */

using System;

namespace Ragima {
    /// <summary>
    /// Условие на ману (содержит стихию и значение)
    /// Итоговое значение требуемой маны зависит от игрока
    /// </summary>
    public class ManaCondition: Condition {
        public readonly ElementType Element;
        public readonly int Value;

        public ManaCondition() {}
        public ManaCondition(ElementType element, int value) {
            Element = element;
            Value = value;
        }

        public override bool Test(AbstractObject caster, Card card) {
            return caster.Owner.GetMana(Element) >= Value;
        }

        public static readonly ElementPhrase NotEnough = new ElementPhrase("condition.mana.not_enough");

        public override Languages.Phrase Notice {
            get { return NotEnough.GetPhrase(Element); }
        }
        public override string NoticeText {
            get { return Notice.GetText(Element); }
        }
    }
}
